#!/usr/bin/python3.8.9
# -*- coding: utf-8 -*-

# @Author  : Tina Yu
# @Time    : 2021-7-17 18:16
from random import randint

"""
练习9-13【骰子】
"""


class Die:
    """
    骰子
    """

    def __init__(self, sides=6):
        self.sides = sides

    def roll_die(self, times):
        results = []
        for i in range(times):
            result = randint(1, self.sides)
            results.append(result)
        print(results)


print('\n**************** 6面骰子，掷10次**************')
die6 = Die()
die6.roll_die(10)

print('\n**************** 10面骰子，掷8次**************')
die10 = Die(10)
die10.roll_die(8)

print('\n**************** 6面骰子，掷5次**************')
die20 = Die(20)
die20.roll_die(5)
